package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(30)" json:"username"`
	Password string `gorm:"type:varchar(32)" json:"password"`
}

type Role struct {
	gorm.Model
	RoleName string `gorm:"type:varchar(30)" json:"role_name"`
}

type Node struct {
	gorm.Model
	NodeName string `gorm:"type:varchar(30)" json:"node_name"`
}

type UserRole struct {
	gorm.Model
	Uid int `gorm:"type:int" json:"uid"`
	Rid int `gorm:"type:int" json:"rid"`
}

type RoleNode struct {
	gorm.Model
	Rid int `gorm:"type:int" json:"rid"`
	Nid int `gorm:"type:int" json:"nid"`
}

type Car struct {
	gorm.Model
	OrderId  int    `gorm:"int" json:"order_id"`
	CarTo    string `gorm:"type:varchar(30)" json:"car_to"`
	CarName  string `gorm:"type:varchar(30)" json:"car_name"`
	CarPrice string `gorm:"type:decimal" json:"car_price"`
}

type CarOrder struct {
	gorm.Model
	OrderTo    string `gorm:"type:varchar(30)" json:"order_to"`
	OrderPrice int    `gorm:"type:int" json:"order_name"`
	Cid        int    `gorm:"type:int" json:"cid"`
}

type CarOrderList struct {
	OrderId    int    `gorm:"int" json:"order_id"`
	CarTo      string `gorm:"type:varchar(30)" json:"car_to"`
	CarName    string `gorm:"type:varchar(30)" json:"car_name"`
	CarPrice   string `gorm:"type:decimal(10,2)" json:"car_price"`
	OrderTo    string `gorm:"type:varchar(30)" json:"order_to"`
	OrderPrice int    `gorm:"type:int" json:"order_name"`
}
